import java.util.Scanner;

public class HW2 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        String password;
        int i=0;
        do {
            System.out.println("请输入密码：");
            password=input.next();
            if ("111111".equals(password)){
                System.out.println("密码正确");
                do {
                    System.out.println("请输入取款金额：");
                    int money = input.nextInt();
                    if (money < 100 && money > 1000 || money % 100 != 0) {
                        System.out.println("您输入的取款金额有误，请重新输入");
                       i=1;
                    } else {
                        System.out.println("您的提款金额为" + money);
                        System.out.println("交易结束，请取卡");
                        i=0;
                    }
                }while (i!=0);
                   return;
            }
            else {
                System.out.println("密码错误");
               i++;
               if (i ==3){
                   System.out.println("密码错误，请取卡");
               }
            }

        }while (i<3);
    }
}
